package com.jc.order.constant;

public enum CompanyNatureEnum {
    STATE_OWNED("1", "国有独资"),
    STATE_CONTROLLED("2", "国有控股"),
    STATE_JOINT("3", "国有联营"),
    PRIVATE("5", "私营企业"),
    INDIVIDUAL("6", "个体企业"),
    TOWNSHIP("11", "乡镇企业"),
    FOREIGN_OWNED("7", "外国独资"),
    JOINT_VENTURE("8", "中外合资"),
    COOPERATION("9", "中外合作"),
    OTHER_NATURE("10", "其他");

    private final String code;
    private final String name;

    CompanyNatureEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static CompanyNatureEnum getByCode(String code) {
        for (CompanyNatureEnum item : CompanyNatureEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}